package com.example.employee.service.impl;

import com.example.employee.entity.EmployeeDO;
import com.example.employee.mapper.EmployeeMapper;
import com.example.employee.service.EmployeeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tc
 * @since 2022-07-20
 */
@Service
public class EmployeeServiceImpl extends ServiceImpl<EmployeeMapper, EmployeeDO> implements EmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;


    @Override
    public List<EmployeeDO> getuser() {
        List<EmployeeDO> list = employeeMapper.getuser();

        return list;
    }


    @Override
    public  String update(String userpwd) {
        EmployeeDO employee = new EmployeeDO();
        employee.setId(1); //主键
        employee.setUserpwd(userpwd); //更新的字段
        //根据id更新，更新不为null的字段
        this.employeeMapper.updateById(employee);
        return "成功";
    }
}
